#!/bin/sh

dockerid=`docker ps -a --no-trunc --filter name=qinglong | grep -v CONTAINER | awk '{print $1}'`

if [[ -n "$dockerid" ]]; then
    docker stop $dockerid && docker rm $dockerid
fi

docker run -dit \
-v /opt/qinglong/ql/config:/ql/config \
-v /opt/qinglong/ql/log:/ql/log \
-v /opt/qinglong/ql/db:/ql/db \
-v /opt/qinglong/ql/scripts:/ql/scripts \
-v /opt/qinglong/ql/jbot:/ql/jbot \
-v /opt/qinglong/ql/ninja:/ql/ninja \
-p 5700:5700 \
-p 5701:5701 \
-e ENABLE_HANGUP=true \
-e ENABLE_WEB_PANEL=true \
--name qinglong \
--hostname qinglong \
--restart always \
whyour/qinglong:2.10.13
